<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui">
	<title>余额账户</title>

	<link rel="stylesheet" type="text/css" href="../addons/zh_yjm/template/mobile/css/index.css">
	<link rel="stylesheet" type="text/css" href="../addons/zh_yjm/template/mobile/css/jquery-weui.css">
	<link rel="stylesheet" type="text/css" href="../addons/zh_yjm/template/mobile/css/weui.min.css"> 
	<style type="text/css">
	
		.weui-navbar{
			background: none!important;
			font-size: 1.4rem;
			line-height: 1.8rem;
		}
		.weui-navbar__item:active , .weui-navbar__item , .weui-bar__item--on ,  .weui-navbar__item , .weui-navbar:after , .weui-navbar__item:after{
			background: none!important;
			border: none;
			font-size: 1.4rem;
			padding: 0;
			line-height: 3.2rem;
			color: #333;
		}

		 .weui-navbar__item span{
		 	font-size: 1.4rem;
		 	display: inline-block;
		 	line-height: 3.2rem;
		 }
		.weui-bar__item--on span{
			 font-size: 1.4rem;
			color: red;
			border-bottom: 0.1rem solid red;
			background: none;
		}
		.weui-tab__bd-item {
			margin-top: 2rem;
			width: 94%;
			padding: 0 3%;
		}
	</style>
</head>
<body>
	<div class="account_top">
	</div>

	<div class="weui-tab">
	  <div class="weui-navbar" style="border-bottom: 0.05rem solid #bbb;">
	    <a class="weui-navbar__item weui-bar__item--on" href="#tab1">
	      <span>充值记录</span>
	    </a>
	    <a class="weui-navbar__item" href="#tab2">
	      <span>消费记录</span>
	    </a>
	  </div>
	  <div class="weui-tab__bd">
	    <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
	    	<div class="noData">
				<img src="../addons/zh_yjm/template/mobile/images/noData.png">
				<p>暂无数据</p>
			</div>
	      <!-- <div class="account_list">
			<div class="time">20181001&nbsp;&nbsp;09:50:03</div>
			<div class="num">充值2000元</div>
			<div class="waiter">菲菲</div>
	      </div> -->
	    </div>
	    <div id="tab2" class="weui-tab__bd-item">
	    	<div class="noData">
				<img src="../addons/zh_yjm/template/mobile/images/noData.png">
				<p>暂无数据</p>
			</div>


	      <!-- <div class="account_list">
			<div class="time" style="width: 50%">
				<p>20181001&nbsp;&nbsp;09:50:03</p>

				<p>洗剪吹-造型</p>
			</div>
			<div class="num" style="width: 50%">
				<p>消费2000元</p>

				<p>菲菲</p>
			</div>

	      </div> -->
	    </div>
	  </div>
	</div>
	

</body>

<script type="text/javascript" src='../addons/zh_yjm/template/mobile/js/jquery-2.1.4.js'></script>
<script src='../addons/zh_yjm/template/mobile/js/swiper.js'></script>
<script type="text/javascript" src='../addons/zh_yjm/template/mobile/js/index.js'></script>
<script type="text/javascript" src='../addons/zh_yjm/template/mobile/js/jquery-weui.js'></script>
<script type="text/javascript" src='../addons/zh_yjm/template/mobile/js/jquery-weui.min.js'></script>

<script type="text/javascript">
$(function () {
	var money = sessionStorage.getItem("money");
	var phone = sessionStorage.getItem("phone");
	console.log(money)
	console.log(phone)
	$(".account_top").html("余额："+money)

	var url=window.location.href;
     
        console.log(url);
        url=url.toString();
        var array=url.split("&id=");
        var id=array[1]
        console.log(id)

    $.ajax({
	            type:"get",
	            url:"{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=Moneyhis&m=zh_yjm",
	            async:true,
	            dataType:"json",
	            data:{store_id:id,phone:phone},
	            success:function(data){
	            	console.log(data)
	               if(data.code==200){
	               		for (var i =0 ;i<data.data.length;i++) {
	               			var str="<div class='account_list'> <div class='time'>"+data.data[i].time+"</div><div class='num'>充值"+data.data[i].money+"元</div><div class='waiter'>"+data.data[i].assistant+"</div></div>"

	               			$("#tab1").append(str)
	               		}
	               	}else if(data.code==500){
	               		$(".noData").css("display",'block')
	               }
	            },

	            error : function(data) {

	                alert(data.msg);

	                return false

	            }
	        })


    $.ajax({
	            type:"get",
	            url:"{$_W['siteroot']}app/index.php?i={$_W['uniacid']}&c=entry&a=site&do=Moneyhisx&m=zh_yjm",
	            async:true,
	            dataType:"json",
	            data:{store_id:id,phone:phone},
	            success:function(data){
	            	console.log(data)
	               if(data.code==200){
	               		for (var i =0 ;i<data.data.length;i++) {
	               			var str="<div class='account_list'><div class='time' style='width: 50%'><p>"+data.data[i].time+"</p><p>"+data.data[i].title+"-"+data.data[i].project+"</p></div><div class='num' style='width: 50%'><p>消费"+data.data[i].money+"元</p><p>"+data.data[i].assistant+"</p></div></div>"

	               			$("#tab2").append(str)
	               		}
	               	}else if(data.code==500){
	               		$(".noData").css("display",'block')
	               }
	            },

	            error : function(data) {

	                alert(data.msg);

	                return false

	            }
	        })
})

</script>
</html>